﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Brain.Editor;
using Brain.Rendering;

namespace Brain.Plugins
{
    public class DefaultRenderManager2DPlugin : IEditorPlugin
    {
        public string[] RelativeDLLs
        {
            get { return null; }
        }

        public DefaultRenderManager2D RenderManager;

        public void Load()
        {
            RenderManager = new DefaultRenderManager2D(Engine.Instance.GraphicsDevice);
            Engine.Instance.AddManager(RenderManager);

            GameScreen g = Engine.Instance.ScreenManager.GetScreen(0);
            if (g != null)
            {
                for (int i = 0; i < g.AllComponents.Count; i++)
                {
                    IBaseComponent comp = g.AllComponents[i];
                    if (comp is Camera2D)
                    {
                        return;
                    }
                }
                Camera2D Camera = new Camera2D(g);
                Engine.Instance.CameraManager.Camera2D = Camera;
            }
        }

        public void Reload()
        {
            RenderManager = new DefaultRenderManager2D(Engine.Instance.GraphicsDevice);
            Engine.Instance.AddManager(RenderManager);
        }

        public void EndReload()
        {
            
        }
    }
}
